# Copyright 2022 99Cloud, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# flake8: noqa
# fmt: off

"""rdw-osw-ssw

Revision ID: 41d3255a429a
Revises: f21ae76770ce
Create Date: 2023-02-17 16:14:49.145915

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '41d3255a429a'
down_revision = 'f21ae76770ce'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('osw',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('create_time', sa.DateTime(), nullable=False),
    sa.Column('update_time', sa.DateTime(), nullable=False),
    sa.Column('sensor_pos', sa.JSON(), nullable=False),
    sa.Column('ego_id', sa.String(length=16), nullable=False),
    sa.Column('ego_pos', sa.JSON(), nullable=False),
    sa.Column('speed', sa.Integer(), nullable=False),
    sa.Column('heading', sa.Integer(), nullable=False),
    sa.Column('width', sa.Integer(), nullable=False),
    sa.Column('length', sa.Integer(), nullable=False),
    sa.Column('height', sa.Integer(), nullable=False),
    sa.Column('sec_mark', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_osw_id'), 'osw', ['id'], unique=False)
    op.create_table('rdw',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('create_time', sa.DateTime(), nullable=False),
    sa.Column('update_time', sa.DateTime(), nullable=False),
    sa.Column('sensor_pos', sa.JSON(), nullable=False),
    sa.Column('ego_id', sa.String(length=16), nullable=False),
    sa.Column('ego_pos', sa.JSON(), nullable=False),
    sa.Column('speed', sa.Integer(), nullable=False),
    sa.Column('heading', sa.Integer(), nullable=False),
    sa.Column('width', sa.Integer(), nullable=False),
    sa.Column('length', sa.Integer(), nullable=False),
    sa.Column('height', sa.Integer(), nullable=False),
    sa.Column('sec_mark', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_rdw_id'), 'rdw', ['id'], unique=False)
    op.create_table('ssw',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('create_time', sa.DateTime(), nullable=False),
    sa.Column('update_time', sa.DateTime(), nullable=False),
    sa.Column('sensor_pos', sa.JSON(), nullable=False),
    sa.Column('ego_id', sa.String(length=16), nullable=False),
    sa.Column('ego_pos', sa.JSON(), nullable=False),
    sa.Column('speed', sa.Integer(), nullable=False),
    sa.Column('heading', sa.Integer(), nullable=False),
    sa.Column('width', sa.Integer(), nullable=False),
    sa.Column('length', sa.Integer(), nullable=False),
    sa.Column('height', sa.Integer(), nullable=False),
    sa.Column('sec_mark', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_ssw_id'), 'ssw', ['id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_ssw_id'), table_name='ssw')
    op.drop_table('ssw')
    op.drop_index(op.f('ix_rdw_id'), table_name='rdw')
    op.drop_table('rdw')
    op.drop_index(op.f('ix_osw_id'), table_name='osw')
    op.drop_table('osw')
    # ### end Alembic commands ###
